from util.DbUtil import SqlUtils
from entity.BaseResponse import BaseResponse



def doSearch(page):
    sql = SqlUtils()
    sqlStr = "SELECT * FROM news WHERE TO_DAYS(NOW()) - TO_DAYS(date) = %d" % (page)
    jsonData = sql.executeSerach(sqlStr)
    br = BaseResponse(200, jsonData, "success")

    return br.__dict__
